package org.linlinjava.litemall.admin.web.order_manage;

import org.linlinjava.litemall.admin.service.order_manage.AgedmallFullGiftService;
import org.linlinjava.litemall.admin.vo.full_gift.AddGiftActiveVo;
import org.linlinjava.litemall.admin.vo.full_gift.GiftActiveCountUserVo;
import org.linlinjava.litemall.admin.vo.full_gift.GiftListVo;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;

/**
 * @author wj
 * @date 2021/8/30 14:18
 */
@RestController
@RequestMapping("/full_gift")
public class AgedmallFullGiftController {

    @Resource
    private AgedmallFullGiftService agedmallFullGiftService;


    /**
     * 新增编辑满赠活动
     * @return
     */
    @PostMapping("/addGiftActive")
    public Object addGiftActive(@RequestBody  @Validated AddGiftActiveVo addGiftActiveVo){
        return agedmallFullGiftService.addGiftActive(addGiftActiveVo);
    }


    /**
     * 满赠活动列表
     */
    @GetMapping("/giftList")
    public Object giftList(@Validated GiftListVo giftListVo){
        return agedmallFullGiftService.giftList(giftListVo);
    }


    /**
     *  满赠列表详情
     */
    @GetMapping("/giftActiveCount")
    public Object giftActiveCount(@Validated @NotNull(message = "满赠id不能为空") Integer id){
        return agedmallFullGiftService.giftActiveCount(id);
    }


    /**
     * 满赠用户列表详情
     */
    @GetMapping("/giftActiveCountUser")
    public Object giftActiveCountUser(@Validated GiftActiveCountUserVo giftActiveCountUserVo){
       return agedmallFullGiftService.giftActiveCountUser(giftActiveCountUserVo);
    }

}
